﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using $myprojectname$.Infrastructure.Abstract.Services;

namespace $myprojectname$.Infrastructure.Services
{
    /// <summary>
    /// Log4Net logging service implementation.
    /// </summary>
    public class Log4NetLoggingService : ILoggingService
    {
        private ILog logger;

        public Log4NetLoggingService()
        {
            logger = LogManager.GetLogger(
                System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        }

        public void Info(string message)
        {
            logger.Info(message);
        }
        public void Warn(string message)
        {
            logger.Warn(message);
        }
        public void Debug(string message)
        {
            logger.Debug(message);
        }
        public void Error(string message)
        {
            logger.Error(message);
        }
        public void Error(Exception ex)
        {
            logger.Error(ex.Message, ex);
        }
        public void Fatal(string message)
        {
            logger.Fatal(message);
        }
        public void Fatal(Exception ex)
        {
            logger.Fatal(ex.Message, ex);
        }
    }
}